package com.exercise.poly_.polyarr_;

public class teacher extends person{
    private double salary;

    public teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String say() {
        return super.say() + "\t" + "salary=" + salary;
    }
    //teacher特有的方法
    public void teach(){
        System.out.println("老师" + getName() + "正在教学java...");
    }
}
